Some changes to fix build problems in FreeBSD and Windows.
authorKevin Cozens <kcozens@cvs.gnome.org>
Mon, 1 Jan 2007 20:58:45 +0000 (20:58 +0000)
committerKevin Cozens <kcozens@src.gnome.org>
Mon, 1 Jan 2007 20:58:45 +0000 (20:58 +0000)
2007-01-01  Kevin Cozens  <kcozens@cvs.gnome.org>

Some changes to fix build problems in FreeBSD and Windows.

* configure.ac: Added missing m4 defines specifying version numbers,
and tests for libdl and libm (sets DL_LIB and MATH_LIB respectively).

* babl.pc.in: Replaced several hard-coded items with ones defined
when configure is run.

* babl/base/Makefile.am:
* extensions/Makefile.am:
* tests/Makefile.am: Use $(DL_LIB) and $(MATH_LIB) instead of
hard-coded options.

svn path=/trunk/; revision=188

ChangeLog
babl.pc.in
babl/base/Makefile.am
configure.ac
extensions/Makefile.am
tests/Makefile.am

index 91cce8daac6db4f5fc6cf10eea37450bb2ab64c9..2fa8e839e1d4fe68668358218b2b36df68deedb0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2007-01-01  Kevin Cozens  <kcozens@cvs.gnome.org>
+
+       Some changes to fix build problems in FreeBSD and Windows.
+
+       * configure.ac: Added missing m4 defines specifying version numbers,
+       and tests for libdl and libm (sets DL_LIB and MATH_LIB respectively).
+
+       * babl.pc.in: Replaced several hard-coded items with ones defined
+       when configure is run.
+
+       * babl/base/Makefile.am:
+       * extensions/Makefile.am:
+       * tests/Makefile.am: Use $(DL_LIB) and $(MATH_LIB) instead of
+       hard-coded options.
+
 2006-12-29  Øyvind Kolås  <pippin@gimp.org>
 
        * configure.ac: set the version of babl to 0.0.9
index aa11ea8bded292d52b74d590887ff59629c0424b..f4dc741f6843091ee1937fa78a75fbd7d01d6e9e 100644 (file)
@@ -4,8 +4,8 @@ libdir=@libdir@
 includedir=@includedir@
 
 Name: babl
-Description: Dynamic; any to any, pixel format conversion library
-Version: @VERSION@
-Libs: -L${libdir} -lbabl -ldl -lm
+Description: Dynamic, any to any, pixel format conversion library
+Version: @BABL_REAL_VERSION@
+Libs: -L${libdir} -lbabl-@BABL_API_VERSION@ @DL_LIB@ @MATH_LIB@
 Cflags: -I${includedir}/@PACKAGE_NAME@-@BABL_API_VERSION@
 
index adbb139dacbc8ffe4e619cc1f568d573608e5ac6..2019ab6dc466c062044ef3056168e77f676ac93b 100644 (file)
@@ -23,4 +23,4 @@ EXTRA_DIST :=                 \
        rgb-constants.h \
        util.h
 
-LDADD = -lm
+LDADD = $(MATH_LIB)
index ca4dd491c024fe7c1b4a4452a112f72d26a22cde..669811e0689234850892a7bc0d98a8bb8be6f068 100644 (file)
@@ -3,6 +3,9 @@ AC_PREREQ(2.54)
 m4_define([babl_major_version], 0)
 m4_define([babl_minor_version], 0)
 m4_define([babl_micro_version], 9)
+m4_define([babl_real_version],
+          [babl_major_version.babl_minor_version.babl_micro_version])
+m4_define([babl_version], [babl_real_version])
 
 AC_INIT(babl, babl_major_version.babl_minor_version.babl_micro_version)
 AC_CONFIG_SRCDIR(babl/babl.h)
@@ -12,6 +15,7 @@ BABL_MINOR_VERSION=babl_minor_version
 BABL_MICRO_VERSION=babl_micro_version
 BABL_REAL_VERSION=babl_real_version
 BABL_VERSION=babl_version
+AC_SUBST(BABL_REAL_VERSION)
 
 BABL_API_VERSION=babl_major_version.babl_minor_version
 AC_SUBST(BABL_API_VERSION)
@@ -53,7 +57,7 @@ if eval "test x$GCC = xyes"; then
   esac
 fi
 
-babl_extension_dir="$(libdir)/babl"
+babl_extension_dir="$libdir/babl"
 AC_SUBST(babl_extension_dir)
 
 AC_PATH_PROG(INKSCAPE, inkscape, no)
@@ -115,11 +119,13 @@ esac
 AC_MSG_RESULT([$platform_win32])
 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
 
+MATH_LIB=-lm
 AC_MSG_CHECKING([for native Win32])
 case "$target_or_host" in
   *-*-mingw*)
     os_win32=yes
     PATHSEP=';'
+    MATH_LIB=
     ;;
   *)
     os_win32=no
@@ -128,12 +134,16 @@ case "$target_or_host" in
 esac
 AC_MSG_RESULT([$os_win32])
 AC_SUBST(PATHSEP)
+AC_SUBST(MATH_LIB)
 
 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
 AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
 
 dnl ===========================================================================
 
+AC_CHECK_LIB([dl], [dlopen], [DL_LIB="-ldl"])
+AC_SUBST(DL_LIB)
+
 AC_DEFINE_UNQUOTED(BABL_PATH, "~/.babl-$BABL_API_VERSION:/usr/local/lib/babl-$BABL_API_VERSION:/usr/lib/babl-$BABL_API_VERSION", [search path for babl extensions (default value of enviroment variable)])
 AC_DEFINE(BABL_PATH_SEPERATOR, "/", [string used to seperate directories in a path string]) 
 AC_DEFINE(BABL_LIST_SEPERATOR, ':', [seperator between paths in BABL_PATH])
index e6a0fcb3b1e6e2a6f03401727d3b36db7f3fafef..aff9ec08f1f61e8673fbdd2c8e60b903c210dbd3 100644 (file)
@@ -30,7 +30,7 @@ LDADD    = $(win32_libs) $(no-undefined)
 #      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<  [own compile and link flags]
 
 CIE-Lab.so: CIE-Lab.c
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDADD) -lm
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDADD) $(MATH_LIB)
 #lcms.so: lcms.c
 #      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDADD) `pkg-config lcms --cflags --libs`
 #############################################################################
index 7302794cd283ab6ec789cdbd1b9547ebac31e668..946047b7e07ff8deced0adeea30da6ba4e11155a 100644 (file)
@@ -1,8 +1,3 @@
-if OS_WIN32
-else
-dl = -ldl
-endif
-
 TESTS =                                \
        grayscale_to_rgb        \
        rgb_to_bgr              \
@@ -30,7 +25,7 @@ models_SOURCES              = models.c
 
 AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/babl
 
-LDADD = $(top_builddir)/babl/libbabl.la -lm ${dl}
+LDADD = $(top_builddir)/babl/libbabl.la $(DL_LIB) $(MATH_LIB)
 
 noinst_PROGRAMS =              \
        introspect              \